import React, { memo,  useState } from 'react'
import useLogInfo from '../../../hooks/useLogInfo'

const HookHome = memo(()=>{
  useLogInfo()
  return (
    <div>HookHome</div>
  )
})

const HookAbout = memo(()=>{
  useLogInfo()
  return (
    <div>HookAbout</div> 
  )
})

const HookDemo = memo(() => {
  const [isShow,setIsShow] = useState(true) 
  useLogInfo()
  return (
    <div>
      <h1>HookDemo</h1>
      {isShow && <HookHome/>}
      {isShow && <HookAbout/>}
     
      <button onClick={e => setIsShow(!isShow)}>切换状态</button>
    </div>
    
  )
})

export default HookDemo